<?php

declare(strict_types=1);

namespace app\common\model;

use app\common\model\user\UserModel;
use Dengje\Pxy\BaseModel;

class ScienceModel extends BaseModel
{
    protected $name = 'science';
    
    /**
     * 关联分类模型
     * @return \think\model\relation\BelongsTo
     */
    public function category()
    {
        return $this->belongsTo(ScienceCategoryModel::class, 'category_id', 'id');
    }

    public function user()
    {
        return $this->belongsTo(UserModel::class, 'user_id', 'id');
    }
}